<template>
  <div>
    <!-- 首页商品分类全局组件(其他路由组件也使用) -->
    <TypeNav />
    <!-- 首页子组件:轮播图区域 -->
    <List />
    <!-- 今日推荐 -->
    <Recommend />
    <!-- 首页热卖排行 -->
    <Rank />
    <!-- 猜你喜欢 -->
    <Like/>
    <!-- 楼层组件 -->
    <Floor v-for="(floor,index) in floorArr" :key="floor.id" :floor="floor"/>
    <!-- 商标 -->
    <Brand/>
  </div>
</template>


<script>
import List from './list'
import Recommend from './recommend'
import Rank from './rank'
import Like from './like'
import Floor from './floor'
import Brand from './brand'
import {mapState} from 'vuex'
  export default {
    name:'Home',
    components:{
      List,
      Recommend,
      Rank,
      Like,
      Floor,
      Brand
    },
    mounted(){
        this.$store.dispatch('getfloor')
    },
    computed:{
      ...mapState({
        floorArr:(state)=>state.home.floorArr
      })
    }
  }
</script>

<style lang="less" scoped>
  
</style>